package com.example.helloworld;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;

import android.view.Menu;

//patron de herencia para heredar del componente.
public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);//coge la vista
		String asunto="Asunto";
		String texto="Algo de texto";
		Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
		emailIntent.setType("plain/text");
		emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{"contacto@decharlas.com"});
		emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, asunto);
		emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, texto);
		startActivity(Intent.createChooser(emailIntent, "send your email in:"));
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	
	
	
	
	

}
